class JavaWeekUtil {
  static Map<int, String> javaMap = {
    1: 'sun',
    2: 'mon',
    3: 'tue',
    4: 'wed',
    5: 'thu',
    6: 'fri',
    7: 'sat',
  };

  static List<String> get javaStringWeek => javaMap.values.toList();

  static Map<int, String> chWeekMap = {
    1: '星期日',
    2: '星期一',
    3: '星期二',
    4: '星期三',
    5: '星期四',
    6: '星期五',
    7: '星期六',
  };

  static Map<int, int> dartJavaWeek = {
    1: 7,
    2: 1,
    3: 2,
    4: 3,
    5: 4,
    6: 5,
    7: 6,
  };

  //java数字转dart数字
  static int javaInteger2dart(int week) {
    return dartJavaWeek[week];
  }

  //java字符串转dart数字
  static int javaString2dart(String week) {
    return javaInteger2dart(javaString2JavaInteger(week));
  }

  //java字符串转java数字
  static int javaString2JavaInteger(String week) {
    final index = javaStringWeek.indexOf(week);

    return javaMap.keys.toList()[index];
  }

  //java数字转java字符
  static String javaInteger2JavaString(int week) {
    return javaMap[week];
  }

  //java字符转汉字
  static String javaString2CHString(String week) {
    return chWeekMap[javaString2JavaInteger(week)];
  }

  //java数字转汉字
  static String javaInteger2CHString(int week) {
    return chWeekMap[week];
  }

  //dart数字转java数字
  static int dart2JavaInteger(int week) {
    final index = dartJavaWeek.values.toList().indexOf(week);
    return dartJavaWeek.values.toList()[index];
  }

  //dart数字转java字符
  static String dart2JavaString(int week) {
    return javaInteger2JavaString(dart2JavaInteger(week));
  }
}
